<%@ Page Language="C#" MasterPageFile="~/AdminCP/AdminCP.master" AutoEventWireup="true"
    CodeFile="Orders.aspx.cs" Inherits="AdminCP_Orders" Title="Untitled Page" %>

<%@ Register Src="../include/Pager.ascx" TagName="Pager" TagPrefix="uc1" %>
<asp:Content ID="ContentOrdersTitle" ContentPlaceHolderID="CphTitle" runat="Server">
    <%=Resources.Lang.Orders %>
</asp:Content>
<asp:Content ID="ContentOrdersScript" ContentPlaceHolderID="CphScriptCss" runat="Server">
</asp:Content>
<asp:Content ID="ContentOrdersBody" ContentPlaceHolderID="CphBody" runat="Server">

    <script language="javascript">
function ConfirmToComplete(id)
{
    if (confirm("<%=Resources.Lang.ConfirmToCompleted%>"))
        window.location = "Orders.aspx?do=tocompleted&oid=" + id;
}
    </script>

    <div id="middle">
        <div id="left-column">
            <a href="#" class="link">Test </a>
            <ul class="nav">
                <li><a href="#">Test </a></li>
                <li class="last"><a href="#">Test </a></li>
            </ul>
        </div>
        <div id="center-column">
            <div class="top-bar">
                <h1>
                    <%=Resources.Lang.admincpOrders%>
                </h1>
            </div>
            <br />
            <br />
            <br />
            <div class="table">
                <img src="AdminImages/bg-th-left.gif" width="8" height="7" alt="" class="left" />
                <img src="AdminImages/bg-th-right.gif" width="7" height="7" alt="" class="right" />
                <table class="listing" cellpadding="0" cellspacing="0">
                    <tr>
                        <th class="first">
                            <%=Resources.Lang.Date %>
                        </th>
                        <th>
                            <%=Resources.Lang.Customers %>
                        </th>
                        <th>
                            <%=Resources.Lang.admincpProducts %>
                        </th>
                        <th>
                            <%=Resources.Lang.Total %>
                        </th>
                        <th>
                            <%=Resources.Lang.State  %>
                        </th>
                        <th class="last">
                            <%=Resources.Lang.Action  %>
                        </th>
                    </tr>
                    <asp:Repeater ID="rptOrders" runat="server">
                        <ItemTemplate>
                            <tr>
                                <td class="first" width="15%">
                                    <%#Web.Core.Utils.ChangeDateFormatBySession((string)DataBinder.Eval(Container.DataItem,"DateAdded"))%>
                                </td>
                                <td width="15%">
                                    <%# Web.Core.Objects.Members.GetMemberByID(Web.Core.Objects.Carts.SelectCartByID((int)DataBinder.Eval(Container.DataItem,"ShoppingCartID")).MemberID).Email%>
                                </td>
                                <td width="35%">
                                    <%#Web.Core.Objects.Carts.GetSummaryProductsInCart((int)DataBinder.Eval(Container.DataItem,"ShoppingCartID"))%>
                                </td>
                                <td width="15%">
                                    <%#Web.Core.Objects.Carts.GetTotalPriceOfCart((int)DataBinder.Eval(Container.DataItem,"ShoppingCartID"))%>
                                    $
                                </td>
                                <td width="15%">
                                    <%#GetState((int)DataBinder.Eval(Container.DataItem,"OrderID"))%>
                                </td>
                                <td class="last" width="5%">
                                    <a href="Orders.aspx?do=del&oid=<%#DataBinder.Eval(Container.DataItem,"OrderID")%>">
                                        <img src="AdminImages/hr.gif" /></a>
                                </td>
                            </tr>
                        </ItemTemplate>
                        <AlternatingItemTemplate>
                            <tr class="bg">
                                <td class="first">
                                    <%#Web.Core.Utils.ChangeDateFormatBySession((string)DataBinder.Eval(Container.DataItem,"DateAdded"))%>
                                </td>
                                <td>
                                    <%# Web.Core.Objects.Members.GetMemberByID(Web.Core.Objects.Carts.SelectCartByID((int)DataBinder.Eval(Container.DataItem,"ShoppingCartID")).MemberID).Email%>
                                </td>
                                <td>
                                    <%#Web.Core.Objects.Carts.GetSummaryProductsInCart((int)DataBinder.Eval(Container.DataItem,"ShoppingCartID"))%>
                                </td>
                                <td>
                                    <%#Web.Core.Objects.Carts.GetTotalPriceOfCart((int)DataBinder.Eval(Container.DataItem,"ShoppingCartID"))%>
                                    $
                                </td>
                                <td>
                                    <%#GetState((int)DataBinder.Eval(Container.DataItem,"OrderID"))%>
                                </td>
                                <td class="last">
                                    <a href="Orders.aspx?do=del&oid=<%#DataBinder.Eval(Container.DataItem,"OrderID")%>">
                                        <img src="AdminImages/hr.gif" /></a>
                                </td>
                            </tr>
                        </AlternatingItemTemplate>
                    </asp:Repeater>
                </table>
                <div class="select">
                    <uc1:Pager ID="Pager1" runat="server" />
                </div>
            </div>
            <br />
            <br />
            <asp:PlaceHolder ID="PlaceHolderBottom" runat="server"></asp:PlaceHolder>
        </div>
        <div id="right-column">
            <strong class="h">
                <%=Resources.Lang.admincpInfo %>
            </strong>
            <div class="box">
                <%=Resources.Lang.admincpOrdersInfo%>
            </div>
        </div>
    </div>
</asp:Content>
